﻿using ArtheaEngine;

namespace ArtheaServer.Commands
{
    public class ColorCommand : Command
    {
        public ColorCommand() : base("color", "Toggles color codes on or off.")
        {
        }

        #region Overrides of Command

        public override void Execute(Character ch, Argument argument)
        {
            if (!(ch is Player)) return;

            if (ch.Flags.And(Player.Color))
            {
                ch.Flags &= ~Player.Color;
                ch.WriteLine("Color off.");
            }
            else
            {
                ch.Flags |= Player.Color;
                ch.WriteLine("~!?~?Color on!~x");
            }
        }

        #endregion
    }
}